import Redux,{createStore} from 'redux';
function inc() {
    return {type:"INCREMENT"}
}
function dec() {
    return {type:"DECREMENT"}
}
function reduce1(state,action) {
    state=state||{counter:0};
    switch (action.type){
        case "INCREMENT":
            return {counter:state.counter+1};
            break;
        case "DECREMENT":
            return {counter:state.counter-1};
            break;
        default:
            return state;
    }
}
var store=createStore(reduce1);
console.log(store.getState());

store.dispatch(inc());
console.log(store.getState());

store.dispatch(inc());
console.log(store.getState());

store.dispatch(dec());
console.log(store.getState());